<template>
  <view class="content">
    <view class="g-header">
    </view>
    <view class="innerPre">
    </view>
    <view class="inner">
      <view class="welcome">欢迎光临</view>
    </view>
    <view class="innerNext">
    </view>
  </view>
</template>

<script>
import * as util from '@/common/util'
import _ from 'lodash'

let flag = 0

export default {
  components: {},
  data(){
    return {}
  },
  onLoad(){
    console.log(`onLoad`, 1)
    this.pageShouldShow()
  },
  onShow(){
    console.log(`onShow`, 1)
    this.pageShouldShow()
    // 底部菜单隐藏
    // uni.hideTabBar()
  },
  onReady(){
    console.log(`onReady`, 1)
  },
  mounted(){
    console.log(`mounted`, 1)
  },
  methods: {
    pageShouldShow(){
      setTimeout(() => {
        this.goHome()
      }, 1000)
      // if (util.modelGet('appInfo.is_flash') === 1) {
      //   if (this.modelGet('appInfo.isIndexLoad')) {
      //     this.goHome()
      //   }
      // } else {
      //   this.goHome()
      // }
    },
    goHome(){
      this.modelSet('appInfo.isIndexLoad', true)
      let homePagePath = this.modelGet('appInfo.homePageUrl') // appInfo.menuList[0].tabbar_url
      console.log(`homePagePath`, homePagePath)
      if (homePagePath) {
        if (homePagePath === '/pages/index/index') {
          util.message('菜单配置错误~')
        } else {
          util.linkTo(homePagePath, 'replaceAll')
        }
      } else {
        util.message('菜单获取失败~')
      }
    },
  },
}
</script>
<style lang="scss">
page {
  background: #177FFF;
}

.content {
}

.inner {
  position: relative;

}

.canvasWrap {
  position: absolute;
  top: 50px;
  right: 50px;
  .canvas1 {
    width: 150px;
    height: 150px;
  }
}

.pageBg {
  width: 100vw;
  height: 100vh;
}

.welcome {
  width: 100%;
  height: 50vh;
  display: flex;
  justify-content: center;
  align-items: center;

  font-size: 50px;
  color: white;

}


</style>
